'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const db = uniCloud.database(); //代码块为cdb
	const collection = db.collection('notice');
	
	let queryStringParameters = event.queryStringParameters
	
	collection.where({_id: queryStringParameters['_id']}).update({
		author: queryStringParameters['author'],
		title: queryStringParameters['title'],
		pubTime: queryStringParameters['pubTime'],
		type: queryStringParameters['type'],
		imgUrl: queryStringParameters['imgUrl'],
		content: queryStringParameters['content'],
		userId: queryStringParameters['userId'],
	}).then(res => {
		console.log(res,'匹配成功')
	})
	.catch(err => {
		console.log(err)
	})
	return {
		mesg: '保存成功！',
		code: 200
	}
};
